﻿<div class="modal-content modal-content-fix">
	<form method="post" action="{:url('seatsel_manage/orderRefund/doRefund')}" class="form-horizontal J_dialogForm">
		<input type="hidden" name="channel" value="{$channel}" />
		<input type="hidden" name="refundId" value="{$refundId}" />
		<input type="hidden" name="orderId" value="{$orderId}" />
		<input type="hidden" name="orderPid" value="{$orderPid}" />
		<input type="hidden" name="formhash" value="{$formhash}" />
		
		<div class="modal-body">
			<div class="alert alert-warning" style="margin-left:0;">
				商家主动退款功能是一个实验性的产品，仅作为退款维权业务的补充功能，请勿过度依赖和使用。
			</div>
			<?php
				$allowRefunFee = $orderInfo['total_fee'] - $orderInfo['refund_fee'];
			?>
			<table class="table table-bordered mb10">
				<thead>
					<tr>
						<th>商品</th>
						<th width="140">可退金额（元）</th>
					</tr>
				</thead>
				<tbody>
					{volist name="orderProductList" id="vo"}
					<?php
						$productInfo = $productList[$vo['pid']];
					?>
					<tr>
						<td>
							<a href="{:url('mobmall/product/detail', ['pid'=>$vo['pid']])}" target="_blank">{$vo['region_name']}{$vo['pai']}{$vo['zuo']}</a>
							{if condition="$productInfo['is_spec_open'] eq 1"}
								<div class="c-gray">
									{$productInfo['spec_name_1']}:{$vo['spec_1']}
									{$productInfo['spec_name_2']}:{$vo['spec_2']}
								</div>
							{/if}
						</td>
						<td>{$vo['real_price']}</td>
					</tr>
					{/volist}
					<tr>
						<td></td>
						<td>总金额：{$allowRefunFee}</td>
					</tr>
				</tbody>
			</table>
			<div class="form-group">
				<label class="col-sm-3 control-label">退款金额（元）</label>
				<div class="col-sm-5">
					<input type="text" name="refund_fee" placeholder="请输入退款金额" class="form-control J_refund_fee" />
				</div>
				<div class="col-sm-4"></div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">退款原因</label>
				<div class="col-sm-5">
					<input type="text" name="refund_reason" placeholder="请输入退款原因" class="form-control" />
				</div>
				<div class="col-sm-4"></div>
			</div>
		</div>
		<div class="modal-footer">
			<p class="pull-left" style="display:none;">
				退款给买家/付款人：<span class="ui-money-outlay J_refund_fee_money">0.00</span>
			</p>
			<button class="btn btn-primary btn-sm pull-right J_dialogSubmit">确定</button>
		</div>
	</form>
</div>

<script type="text/javascript" src="__STATIC__/Zz22zzUI/js/zzdialoglayer.js"></script>

<script type="text/javascript">
$('.J_refund_fee').on('keyup', function(){
	var tVal = $(this).val();
	$('.J_refund_fee_money').html(tVal);
});
</script>